CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

SET(PROJECTNAME M3DMain)

PROJECT(${PROJECTNAME})

FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui REQUIRED)

SET(QT_USE_QTGUI TRUE)
SET(QT_USE_QTOPENGL TRUE)

INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})

FILE(
	GLOB_RECURSE
	FILES_SRC
	Sources/*
)

SET(
	MOC_HDRS
     	./Headers/MainWindow.h
)

QT4_WRAP_CPP(
	MOC_SRCS
	${MOC_HDRS}
)

INCLUDE_DIRECTORIES(
	${QT_DEFINITIONS}
	${QT_QTOPENGL_INCLUDE_DIR}
	./Headers
	../../GEN/GENErrors/Headers
	../M3DWidgets/Headers
)

LINK_DIRECTORIES(
	../../GEN/GENErrors
	../M3DWidgets
)

ADD_EXECUTABLE(
	${PROJECTNAME}
	${FILES_SRC}
	${MOC_SRCS}
)

TARGET_LINK_LIBRARIES(
	${PROJECTNAME}
	${QT_LIBRARIES}
	${QT_QTOPENGL_LIBRARY}
	GENErrors
	M3DWidgets
)

